<template>
	<view class="memberList">
		<view v-for="(item,index) in memberList" :key="index" class="list-box">
			<view>
				<view class="header">
					<view class="title">
						<view class="name">
							{{item.idCardName}} ({{item.gender}} {{item.type_name}})
						</view>
						<view class="status">
							<uni-tag 
								v-if="item.check_status[1]!='正常'"
								:text="item.check_status[1]" 
								size="small" 
								:inverted="true" 
								:circle="true"
								:type="item.check_status[0]">
							</uni-tag>
							<uni-tag
								v-if="item.state==1"
								text="已禁赛" 
								size="small" 
								:inverted="true" 
								:circle="true"
								:type="item.noEvent"
								class="tag_cell">
							</uni-tag>
						</view>
					</view>
					<view class="extra">
						<!-- <text v-if="item.txt_status=='正常'">{{item.txt_status}}</text>
						<text v-if="item.txt_status!='正常'">{{item.txt_status}}</text> -->
						<view class="">
							<text v-if="item.txt_status=='待审核'" class="red">{{item.txt_status}}</text>
						</view>
						<view class="">
							<!-- <uni-icons type="arrowright" color="#bbbbbb" size="20" /> -->
						</view>
					</view>
				</view>
				<view class="content">
					<view class="content-item"><text>证件号：</text><text>{{item.idCard}}</text></view>
					<view class="content-item"><text>隶属机构：</text><text>{{item.org_name}}</text></view>
					<view class="content-item type-one-item">
						<text>到期时间：</text><text>{{item.sign_time}}</text>
						<view v-if="allSelectFlag" class="type-one">
							<view class="">
									<button type="primary" plain="true" size="mini" class="type-two-btn border-blue" v-show="item.status_value==0&&item.myselfOrg!=1" @click.stop="changeAllocation('chessPicker',item.id)">分配</button>
							</view>
							<view class="">
								<button type="primary" size="mini" class="type-one-btn back-blue" v-show="item.status_value==0" @click.stop="toMemberDetail(item.id)">查看</button>
								<button type="primary" size="mini" class="type-one-btn back-blue" v-show="item.status_value==3&&item.check==1" @click.stop="toCheckMember(item.id)">审核</button>
								<button type="primary" size="mini" class="type-one-btn back-blue" v-show="item.status_value==1" @click.stop="toPay(item)">缴费</button>
							</view>
						</view>
						<view v-else class="type-one">
							<!-- <checkbox value="" /> -->
							<radio @tap.stop="toChangeRadio(item.radio,index)" :value="item.id" :checked="item.radio" v-if="item.status_value!=3&&item.myselfOrg!=1" color="#1A66FF" />
							<view class="noradio" @tap="noAgreeChangeRadio"  v-if="item.status_value==3||item.myselfOrg==1">
								<!-- <radio  :value="item.id" :checked="item.radio" v-if="item.status_value==3||item.myselfOrg==1" disabled="disabled" color="#1A66FF" /> -->
							</view>
						</view>
					</view>
				</view>
			</view>										
		</view>
		
	</view>
</template>
<script>
	import uniTag from "@/components/uni-tag/uni-tag.vue";
	import uniIcons from '@/components/uni-icons/uni-icons.vue'
	export default{
		props:{
			memberList:Array,
			allSelectFlag:{
				type:Boolean,
				default:true
			},
			orgChess:Array
		},
		data(){
			return{
				indexOfChess:0
			}
		},
		components:{
			uniTag,
			uniIcons
		},
		methods:{
			toChangeRadio(e,index){
				var _this=this;
				// e.detail.value=0;
				_this.$emit("toChangeRadio",e,index)	
			},
			changeAllocation(name,id){
				this.$emit("toChangeAllocation",name,id)
			},
			toMemberDetail(id){
				this.$emit("toMemberDetail",id)
			},
			toCheckMember(id){
				this.$emit('toCheckMember',id)
			},
			toPay(id){
				this.$emit("toPay",id)
			},
			noAgreeChangeRadio(){
				uni.showToast({
					title:"该会员非本机构或待审核",
					icon:"none"
				})
			}
		}
	}
</script>
<style lang="less" scoped>
	.list-box{
		display: flex;
		flex: 1;
		box-shadow: 0 0 0 transparent;
		margin: 24rpx;
		background-color: #fff;
		position: relative;
		flex-direction: column;
		border-color: #e5e5e5;
		border-style: solid;
		border-width: 3rpx;
		border-radius: 10rpx;
		overflow: hidden;
		padding: 28rpx 32rpx;
		radio-group label, checkbox-group label {
			padding-right: 0;
		}
		.border-blue{
			border:2rpx solid #1A66FF;
			color: #1A66FF;
		}
		.back-blue{
			background: #1A66FF;
			color: #fff;
		}
		.header{
			display: flex;
			position: relative;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			border-bottom-color: #e5e5e5;
			border-bottom-style: solid;
			border-bottom-width: 2rpx;
			// padding-bottom: 28rpx;
			.title{
				font-size: 32rpx;
				font-weight: bold;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				display: flex;
				flex-direction: row;
				align-items: center;
			}
			.status{
				padding-left: 20rpx;
				text-align: right;
			}
			.extra{
			// flex: 1;
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-left: 16rpx;
			font-size: 28rpx;
			text-align: right;
			color: #007aff;
			}
			.red{
				color: #FF2A2A;
				text-align: right;
			}
		}
		.content{
			padding-top: 8rpx;
			.content-item{
				display: flex;
				justify-content: flex-start;
				padding-top: 6rpx;
				font-size: 28rpx;
			}
			.type-one-item{
				justify-content: flex-start;
				.type-one{
					margin-left: auto;
					margin-right: 20rrpx;
					display: flex;
					flex-direction: row;
				}
				.noradio{
					width: 55rpx;
					height: 55rpx;
					border-radius: 50%;
					background: #d2d2d2;
					margin-right: 17rpx;
				}
				.type-one-btn{
					margin-left: 10rpx;
					border-radius: 30rpx;
					border: 2rpx solid #007aff;
				}
				.type-two-btn{
					border-radius: 30rpx;
					// border: 1rpx solid #007aff;
					// color: #007aff;
				}
				.type-one-label{
					margin-right: 10rpx;
					margin-left: auto;
				}
			}
		}
	}
	.status{
		display: flex;
		flex-direction: row;
		.tag_cell{
			margin-left: 20rpx;
		}
	}
</style>
